<?php if (!defined('THINK_PATH')) exit();?><form id="pagerForm" action="__URL__" method="post">
	<input type="hidden" name="pageNum" value="1"/>
	<input type="hidden" name="_order" value="<?php echo ($_REQUEST["_order"]); ?>"/>
	<input type="hidden" name="_sort" value="<?php echo ($_REQUEST["_sort"]); ?>"/>
    <input type="hidden" name="numPerPage" value="<?php echo ($_REQUEST["numPerPage"]); ?>" />
</form>


<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="__URL__" method="post">
	<div class="searchBar">
		<table>
          <tr>
           <td>关键字：</td>
           <td><input type="text" name="selectname" value=""/></td>
           <td>
                <select class="combox" name="ordertype">
                    <option value="0" <?php if(($_POST['ordertype']) == "0"): ?>selected<?php endif; ?>>所有订单</option>
                	<option value="1" <?php if(($_POST['ordertype']) == "1"): ?>selected<?php endif; ?>>未结案</option>
                	<option value="2" <?php if(($_POST['ordertype']) == "2"): ?>selected<?php endif; ?>>已结案</option>
                </select>
           </td>
          </tr>
         </table> 
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>

<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="__URL__/add" target="navTab" mask="true"><span>新增订单</span></a></li>
			<li><a class="delete" href="__URL__/foreverdelete/id/{sid_user}/navTabId/__MODULE__" target="ajaxTodo" title="警告:删除后无法恢复，你确定要删除这个订单吗？" warn="请选择费用类型"><span>删除订单</span></a></li>
			<!--<li><a class="edit" href="__URL__/edit/id/{sid_user}" target="dialog" mask="true" warn="请选择费用类型"><span>编辑订单</span></a></li>-->
			</ul>
	</div>

	<div layoutH="115" id="w_list_print">
	<table class="list" targetType="navTab" asc="asc" desc="desc">
		<thead>
		<tr>
			<th aling=center>编号</th>
			<th align=center orderField="ordernumber" <?php if($_REQUEST["_order"] == 'ordernumber'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>单据编号</th>
			<th align=center orderField="custid" <?php if($_REQUEST["_order"] == 'custid'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>订购单位</th>
			<th align=center orderField="orderman" <?php if($_REQUEST["_order"] == 'orderman'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>联系人</th>
            <th align=center orderField="ordertime" <?php if($_REQUEST["_order"] == 'ordertime'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>下单日期</th>
            <th align=center orderField="deliverytime" <?php if($_REQUEST["_order"] == 'deliverytime'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>截止日期</th>
            <th align=center orderField="ordernums" <?php if($_REQUEST["_order"] == 'ordernums'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>订单数量</th>
            <th align=center orderField="orderamount" <?php if($_REQUEST["_order"] == 'orderamount'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>订单金额(￥)</th>
            <th align=center orderField="custorder" <?php if($_REQUEST["_order"] == 'custorder'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>客户单据</th>
            <th align=center orderField="createuser" <?php if($_REQUEST["_order"] == 'createuser'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>制单人</th>
            <th align=center orderField="createtime" <?php if($_REQUEST["_order"] == 'createtime'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>建单日期</th> 
            <th align=center orderField="status" <?php if($_REQUEST["_order"] == 'status'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>订单状态</th>     	
		</tr>
		</thead>
		<tbody>
		<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr target="sid_user" rel="<?php echo ($vo['id']); ?>">
				<td align=center><?php echo ($vo['id']); ?></td>
				<td align=center><a href="__URL__/printOrder/orderId/<?php echo ($vo['id']); ?>" class="printOrder" title="<?php echo ($vo['ordernumber']); ?>" target="navTab" mask="true"><?php echo ($vo['ordernumber']); ?></a></td>
				<td><?php echo (gettablecolval($vo['custid'],Contacts,comname)); ?></td> 
                <td align=center><?php echo ($vo['orderman']); ?></td> 
                <td align=center><?php echo (date("Y-m-d",$vo['ordertime'])); ?></td> 
                <td align=center><?php echo (date("Y-m-d",$vo['deliverytime'])); ?></td> 
                <td align=right><?php echo ($vo['ordernums']); ?></td> 
                <td align=right><?php echo ($vo['orderamount']); ?></td> 
                <td align=center><?php echo ($vo['custorder']); ?></td> 
                <td align=center><?php echo (gettablecolval($vo['createuser'],User,nickname)); ?></td> 
                <td align=center><?php echo (date("Y-m-d  H:i:s",$vo['createtime'])); ?></td>
                <td align=center><?php echo (getodestatus($vo['status'])); ?></td>                       
			</tr><?php endforeach; endif; else: echo "" ;endif; ?>
		</tbody>
	</table>
    </div>
	<div class="panelBar">
		<div class="pages">
			<span>共<?php echo ($totalCount); ?>条</span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="<?php echo ($totalCount); ?>" numPerPage="<?php echo ($numPerPage); ?>" pageNumShown="10" currentPage="<?php echo ($currentPage); ?>"></div>
	</div>

</div>